//Tue May 24 20:01:07 CDT 2011
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class AllButOneDivisor {
public:
	int getMinimum(vector<int> divisors) {
		sort(divisors.begin(), divisors.end());
		int K = divisors.size();
		long long product = 1;
		for (int i = 0; i < K; i++)
			product *= divisors[i];
		for (int i = divisors[K - 2]; i<=product; i++) {
			int count = 0;
			for (int j = 0; j < K; j++)
				if (i % divisors[j] == 0)
					count++;
			if (count == K - 1)
				return i;
		}
		return -1;
	}
};

